#include "elisa/elisa.h"
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <gaol/gaol>

#include "Modeler.h"

#ifdef ELISA_PERFORMER
#include "elisa_chrono.h"
#endif

using namespace std;
using namespace elisa;

class CircSin : public Modeler
{
private:
	Model _model;

	RealVar x;
	RealVar y;
	RealConstraint c1;
	RealConstraint c2;

public:
	CircSin()
		: x(Interval(-100, 100), "x"),
		  y(Interval(-100, 100), "y"),
		  c1(sin(4*x) == y),
		  c2(sqr(x) + sqr(y) == 1),
		  _model(c1 && c2)
	{
	}

	elisa::Model & model()
	{
		return _model;
	}

	void print()
	{
		cout << '\t' << x.getName() << " = " << x.domain() << endl;
		cout << '\t' << y.getName() << " = " << y.domain() << endl;
	}

	RealVar & varX()
	{
		return x;
	}
	RealVar & varY()
	{
		return y;
	}
};
